from django.contrib import admin
from .models import Event, EventRegistration, EventPushLog


@admin.register(Event)
class EventAdmin(admin.ModelAdmin):
    list_display = ['title', 'category', 'start_date', 'end_date', 'status', 'created_by']
    list_filter = ['status', 'category', 'start_date']
    search_fields = ['title', 'description', 'tags']


@admin.register(EventRegistration)
class EventRegistrationAdmin(admin.ModelAdmin):
    list_display = ['event', 'user', 'group', 'registration_type', 'status', 'registered_at']
    list_filter = ['registration_type', 'status', 'registered_at']
    search_fields = ['event__title', 'user__username', 'group__name']


@admin.register(EventPushLog)
class EventPushLogAdmin(admin.ModelAdmin):
    list_display = ['event', 'user', 'push_method', 'is_read', 'push_time']
    list_filter = ['push_method', 'is_read', 'push_time']
    search_fields = ['event__title', 'user__username']
